package com.rc.saas.tenant.client;

import com.rc.saas.tenant.common.vo.StdRequest;
import com.rc.saas.tenant.common.vo.TResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 打印机服务
 * Created by Sven on 2021/04/11
 */
@Component
@FeignClient(name = PrinterClient1.SERVICE_NAME, path = PrinterClient1.SERVICE_PATH)
//name是服务方的spring.application.name,指被调用的微服务名称
public interface PrinterClient1 {
    //项目名称
    String SERVICE_NAME = "jinzhuang-saas-printer";
    //项目部署的路径
    String SERVICE_PATH = "/jinzhuang-saas-printer";

    /**
     * 发送打印指令
     * RequestMapping路径是服务提供方的路径
     * @param tRequest
     * @return
     */
    @RequestMapping(value = "/print/query_start_print", method = RequestMethod.POST)
    TResponse query_start_print(@RequestBody StdRequest tRequest);

    /**
     * 重置打印小票次数
     * RequestMapping路径是服务提供方的路径
     * @param tRequest
     * @return
     */
    @RequestMapping(value = "/print/query_reset_print", method = RequestMethod.POST)
    TResponse query_reset_print(@RequestBody StdRequest tRequest);


    /**
     * 凭空打印接口
     * RequestMapping路径是服务提供方的路径
     * @param tRequest
     * @return
     */
    @RequestMapping(value = "/nothing/baselessPrint", method = RequestMethod.POST)
    TResponse query_nothing_print(@RequestBody StdRequest tRequest);

}
